home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / ieeetr.bst < prev    next >
Text File  |  1990-12-10  |  17KB  |  971 lines

  1. % IEEE Transactions bibliography style (29-Jan-88 version)
  2. %    numeric labels, order-of-reference, IEEE abbreviations,
  3. %    quotes around article titles, commas separate all fields
  4. %    except after book titles and before "notes".  Otherwise,
  5. %    much like the "plain" family, from which this is adapted.
  6. %
  7. %   History
  8. %    9/30/85    (HWT)    Original version, by Howard Trickey.
  9. %    1/29/88    (OP&HWT) Updated for BibTeX version 0.99a, Oren Patashnik;
  10. %            THIS `ieeetr' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
  11.  
  12. ENTRY
  13.   { address
  14.     author
  15.     booktitle
  16.     chapter
  17.     edition
  18.     editor
  19.     howpublished
  20.     institution
  21.     journal
  22.     key
  23.     month
  24.     note
  25.     number
  26.     organization
  27.     pages
  28.     publisher
  29.     school
  30.     series
  31.     title
  32.     type
  33.     volume
  34.     year
  35.   }
  36.   {}
  37.   { label }
  38.  
  39. INTEGERS { output.state before.all mid.sentence after.quote after.sentence
  40.         after.quoted.block after.block }
  41.  
  42. FUNCTION {init.state.consts}
  43. { #0 'before.all :=
  44.   #1 'mid.sentence :=
  45.   #2 'after.quote :=
  46.   #3 'after.sentence :=
  47.   #4 'after.quoted.block :=
  48.   #5 'after.block :=
  49. }
  50.  
  51. STRINGS { s t }
  52.  
  53. FUNCTION {output.nonnull}
  54. { 's :=
  55.   output.state mid.sentence =
  56.     { ", " * write$ }
  57.     { output.state after.quote =
  58.     { " " * write$ }
  59.     { output.state after.block =
  60.         { add.period$ write$
  61.           newline$
  62.           "\newblock " write$
  63.         }
  64.         { output.state before.all =
  65.         'write$
  66.         { output.state after.quoted.block =
  67.             { write$
  68.               newline$
  69.               "\newblock " write$
  70.             }
  71.             { add.period$ " " * write$ }
  72.           if$
  73.         }
  74.           if$
  75.         }
  76.       if$
  77.     }
  78.       if$
  79.       mid.sentence 'output.state :=
  80.     }
  81.   if$
  82.   s
  83. }
  84.  
  85. FUNCTION {output}
  86. { duplicate$ empty$
  87.     'pop$
  88.     'output.nonnull
  89.   if$
  90. }
  91.  
  92. FUNCTION {output.check}
  93. { 't :=
  94.   duplicate$ empty$
  95.     { pop$ "empty " t * " in " * cite$ * warning$ }
  96.     'output.nonnull
  97.   if$
  98. }
  99.  
  100. FUNCTION {output.bibitem}
  101. { newline$
  102.   "\bibitem{" write$
  103.   cite$ write$
  104.   "}" write$
  105.   newline$
  106.   ""
  107.   before.all 'output.state :=
  108. }
  109.  
  110. FUNCTION {blank.sep}
  111. { after.quote 'output.state :=
  112. }
  113.  
  114. FUNCTION {fin.entry}
  115. { output.state after.quoted.block =
  116.     'skip$
  117.     'add.period$
  118.   if$
  119.   write$
  120.   newline$
  121. }
  122.  
  123. FUNCTION {new.block}
  124. { output.state before.all =
  125.     'skip$
  126.     { output.state after.quote =
  127.     { after.quoted.block 'output.state := }
  128.     { after.block 'output.state := }
  129.       if$
  130.     }
  131.   if$
  132. }
  133.  
  134. FUNCTION {new.sentence}
  135. { output.state after.block =
  136.     'skip$
  137.     { output.state before.all =
  138.     'skip$
  139.     { after.sentence 'output.state := }
  140.       if$
  141.     }
  142.   if$
  143. }
  144.  
  145. FUNCTION {not}
  146. {   { #0 }
  147.     { #1 }
  148.   if$
  149. }
  150.  
  151. FUNCTION {and}
  152. {   'skip$
  153.     { pop$ #0 }
  154.   if$
  155. }
  156.  
  157. FUNCTION {or}
  158. {   { pop$ #1 }
  159.     'skip$
  160.   if$
  161. }
  162.  
  163. FUNCTION {new.block.checka}
  164. { empty$
  165.     'skip$
  166.     'new.block
  167.   if$
  168. }
  169.  
  170. FUNCTION {new.block.checkb}
  171. { empty$
  172.   swap$ empty$
  173.   and
  174.     'skip$
  175.     'new.block
  176.   if$
  177. }
  178.  
  179. FUNCTION {new.sentence.checka}
  180. { empty$
  181.     'skip$
  182.     'new.sentence
  183.   if$
  184. }
  185.  
  186. FUNCTION {field.or.null}
  187. { duplicate$ empty$
  188.     { pop$ "" }
  189.     'skip$
  190.   if$
  191. }
  192.  
  193. FUNCTION {emphasize}
  194. { duplicate$ empty$
  195.     { pop$ "" }
  196.     { "{\em " swap$ * "}" * }
  197.   if$
  198. }
  199.  
  200. INTEGERS { nameptr namesleft numnames }
  201.  
  202. FUNCTION {format.names}
  203. { 's :=
  204.   #1 'nameptr :=
  205.   s num.names$ 'numnames :=
  206.   numnames 'namesleft :=
  207.     { namesleft #0 > }
  208.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
  209.       nameptr #1 >
  210.     { namesleft #1 >
  211.         { ", " * t * }
  212.         { numnames #2 >
  213.         { "," * }
  214.         'skip$
  215.           if$
  216.           t "others" =
  217.         { " {\em et~al.}" * }
  218.         { " and " * t * }
  219.           if$
  220.         }
  221.       if$
  222.     }
  223.     't
  224.       if$
  225.       nameptr #1 + 'nameptr :=
  226.       namesleft #1 - 'namesleft :=
  227.     }
  228.   while$
  229. }
  230.  
  231. FUNCTION {format.authors}
  232. { author empty$
  233.     { "" }
  234.     { author format.names }
  235.   if$
  236. }
  237.  
  238. FUNCTION {format.editors}
  239. { editor empty$
  240.     { "" }
  241.     { editor format.names
  242.       editor num.names$ #1 >
  243.     { ", eds." * }
  244.     { ", ed." * }
  245.       if$
  246.     }
  247.   if$
  248. }
  249.  
  250. FUNCTION {format.title}
  251. { title empty$
  252.     { "" }
  253.     { "``" title "t" change.case$ * ",''" * }
  254.   if$
  255. }
  256.  
  257. FUNCTION {format.title.p}
  258. { title empty$
  259.     { "" }
  260.     { "``" title "t" change.case$ * ".''" * }
  261.   if$
  262. }
  263.  
  264. FUNCTION {n.dashify}
  265. { 't :=
  266.   ""
  267.     { t empty$ not }
  268.     { t #1 #1 substring$ "-" =
  269.     { t #1 #2 substring$ "--" = not
  270.         { "--" *
  271.           t #2 global.max$ substring$ 't :=
  272.         }
  273.         {   { t #1 #1 substring$ "-" = }
  274.         { "-" *
  275.           t #2 global.max$ substring$ 't :=
  276.         }
  277.           while$
  278.         }
  279.       if$
  280.     }
  281.     { t #1 #1 substring$ *
  282.       t #2 global.max$ substring$ 't :=
  283.     }
  284.       if$
  285.     }
  286.   while$
  287. }
  288.  
  289. FUNCTION {format.date}
  290. { year empty$
  291.     { month empty$
  292.     { "" }
  293.     { "there's a month but no year in " cite$ * warning$
  294.       month
  295.     }
  296.       if$
  297.     }
  298.     { month empty$
  299.     'year
  300.     { month " " * year * }
  301.       if$
  302.     }
  303.   if$
  304. }
  305.  
  306. FUNCTION {format.btitle}
  307. { title emphasize
  308. }
  309.  
  310. FUNCTION {tie.or.space.connect}
  311. { duplicate$ text.length$ #3 <
  312.     { "~" }
  313.     { " " }
  314.   if$
  315.   swap$ * *
  316. }
  317.  
  318. FUNCTION {either.or.check}
  319. { empty$
  320.     'pop$
  321.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  322.   if$
  323. }
  324.  
  325. FUNCTION {format.bvolume}
  326. { volume empty$
  327.     { "" }
  328.     { "vol.~" volume *
  329.       series empty$
  330.     'skip$
  331.     { " of " * series emphasize * }
  332.       if$
  333.       "volume and number" number either.or.check
  334.     }
  335.   if$
  336. }
  337.  
  338. FUNCTION {format.number.series}
  339. { volume empty$
  340.     { number empty$
  341.     { series field.or.null }
  342.     { output.state mid.sentence =
  343.         { "no.~" }
  344.         { "No.~" }
  345.       if$
  346.       number *
  347.       series empty$
  348.         { "there's a number but no series in " cite$ * warning$ }
  349.         { " in " * series * }
  350.       if$
  351.     }
  352.       if$
  353.     }
  354.     { "" }
  355.   if$
  356. }
  357.  
  358. FUNCTION {format.edition}
  359. { edition empty$
  360.     { "" }
  361.     { edition "l" change.case$ "~ed." * }
  362.   if$
  363. }
  364.  
  365. INTEGERS { multiresult }
  366.  
  367. FUNCTION {multi.page.check}
  368. { 't :=
  369.   #0 'multiresult :=
  370.     { multiresult not
  371.       t empty$ not
  372.       and
  373.     }
  374.     { t #1 #1 substring$
  375.       duplicate$ "-" =
  376.       swap$ duplicate$ "," =
  377.       swap$ "+" =
  378.       or or
  379.     { #1 'multiresult := }
  380.     { t #2 global.max$ substring$ 't := }
  381.       if$
  382.     }
  383.   while$
  384.   multiresult
  385. }
  386.  
  387. FUNCTION {format.pages}
  388. { pages empty$
  389.     { "" }
  390.     { pages multi.page.check
  391.     { "pp.~" pages n.dashify * }
  392.     { "p.~" pages * }
  393.       if$
  394.     }
  395.   if$
  396. }
  397.  
  398. FUNCTION {format.volume}
  399. { volume empty$
  400.     { "" }
  401.     { "vol.~" volume * }
  402.   if$
  403. }
  404.  
  405. FUNCTION {format.number}
  406. { number empty$
  407.     { "" }
  408.     { "no.~" number * }
  409.   if$
  410. }
  411.  
  412. FUNCTION {format.chapter.pages}
  413. { chapter empty$
  414.     'format.pages
  415.     { type empty$
  416.     { "ch.~" chapter * }
  417.     { type "l" change.case$ chapter tie.or.space.connect }
  418.       if$
  419.       pages empty$
  420.     'skip$
  421.     { ", " * format.pages * }
  422.       if$
  423.     }
  424.   if$
  425. }
  426.  
  427. FUNCTION {format.in.ed.booktitle}
  428. { booktitle empty$
  429.     { "" }
  430.     { "in " booktitle emphasize *
  431.       editor empty$
  432.     'skip$
  433.     { " (" * format.editors * ")" * }
  434.       if$
  435.     }
  436.   if$
  437. }
  438.  
  439. FUNCTION {format.thesis.type}
  440. { type empty$
  441.     'skip$
  442.     { pop$
  443.       output.state after.block =
  444.     { type "t" change.case$ }
  445.     { type "l" change.case$ }
  446.       if$
  447.     }
  448.   if$
  449. }
  450.  
  451. FUNCTION {empty.misc.check}
  452. { author empty$ title empty$ howpublished empty$
  453.   month empty$ year empty$ note empty$
  454.   and and and and and
  455.     { "all relevant fields are empty in " cite$ * warning$ }
  456.     'skip$
  457.   if$
  458. }
  459.  
  460. FUNCTION {format.tr.number}
  461. { type empty$
  462.     { "Tech. Rep." }
  463.     'type
  464.   if$
  465.   number empty$
  466.     { "l" change.case$ }
  467.     { number tie.or.space.connect }
  468.   if$
  469. }
  470.  
  471. FUNCTION {format.addr.pub}
  472. { publisher empty$
  473.     { "" }
  474.     { address empty$
  475.     { "" }
  476.     { address ": " * }
  477.       if$
  478.       publisher *
  479.     }
  480.   if$
  481. }
  482.  
  483. FUNCTION {format.paddress}
  484. { address empty$
  485.     { "" }
  486.     { "(" address * ")" * }
  487.   if$
  488. }
  489.  
  490. FUNCTION {format.article.crossref}
  491. { key empty$
  492.     { journal empty$
  493.     { "need key or journal for " cite$ * " to crossref " * crossref *
  494.       warning$
  495.       ""
  496.     }
  497.     { "in {\em " journal * "\/}" * }
  498.       if$
  499.     }
  500.     { "in " key * }
  501.   if$
  502.   " \cite{" * crossref * "}" *
  503. }
  504.  
  505. FUNCTION {format.crossref.editor}
  506. { editor #1 "{vv~}{ll}" format.name$
  507.   editor num.names$ duplicate$
  508.   #2 >
  509.     { pop$ " {\em et~al.}" * }
  510.     { #2 <
  511.     'skip$
  512.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  513.         { " {\em et~al.}" * }
  514.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  515.       if$
  516.     }
  517.       if$
  518.     }
  519.   if$
  520. }
  521.  
  522. FUNCTION {format.book.crossref}
  523. { volume empty$
  524.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  525.       "In "
  526.     }
  527.     { "Vol.~" volume *
  528.       " of " *
  529.     }
  530.   if$
  531.   editor empty$
  532.   editor field.or.null author field.or.null =
  533.   or
  534.     { key empty$
  535.     { series empty$
  536.         { "need editor, key, or series for " cite$ * " to crossref " *
  537.           crossref * warning$
  538.           "" *
  539.         }
  540.         { "{\em " * series * "\/}" * }
  541.       if$
  542.     }
  543.     { key * }
  544.       if$
  545.     }
  546.     { format.crossref.editor * }
  547.   if$
  548.   " \cite{" * crossref * "}" *
  549. }
  550.  
  551. FUNCTION {format.incoll.inproc.crossref}
  552. { editor empty$
  553.   editor field.or.null author field.or.null =
  554.   or
  555.     { key empty$
  556.     { booktitle empty$
  557.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  558.           crossref * warning$
  559.           ""
  560.         }
  561.         { "in {\em " booktitle * "\/}" * }
  562.       if$
  563.     }
  564.     { "in " key * }
  565.       if$
  566.     }
  567.     { "in " format.crossref.editor * }
  568.   if$
  569.   " \cite{" * crossref * "}" *
  570. }
  571.  
  572. FUNCTION {article}
  573. { output.bibitem
  574.   format.authors "author" output.check
  575.   format.title "title" output.check
  576.   blank.sep
  577.   crossref missing$
  578.     { journal emphasize "journal" output.check
  579.       format.volume output
  580.       month empty$
  581.     { format.number output }
  582.     'skip$
  583.       if$
  584.       format.pages output
  585.       format.date "year" output.check
  586.     }
  587.     { format.article.crossref output.nonnull
  588.       format.pages output
  589.     }
  590.   if$
  591.   new.block
  592.   note output
  593.   fin.entry
  594. }
  595.  
  596. FUNCTION {book}
  597. { output.bibitem
  598.   author empty$
  599.     { format.editors "author and editor" output.check }
  600.     { format.authors output.nonnull
  601.       crossref missing$
  602.     { "author and editor" editor either.or.check }
  603.     'skip$
  604.       if$
  605.     }
  606.   if$
  607.   format.btitle "title" output.check
  608.   crossref missing$
  609.     { format.bvolume output
  610.       new.block
  611.       format.number.series output
  612.       format.addr.pub "publisher" output.check
  613.     }
  614.     { new.block
  615.       format.book.crossref output.nonnull
  616.     }
  617.   if$
  618.   format.edition output
  619.   format.date "year" output.check
  620.   new.block
  621.   note output
  622.   fin.entry
  623. }
  624.  
  625. FUNCTION {booklet}
  626. { output.bibitem
  627.   format.authors output
  628.   title empty$
  629.     { "empty title in " cite$ * warning$
  630.       howpublished new.sentence.checka
  631.     }
  632.     { howpublished empty$ not
  633.       address empty$ month empty$ year empty$ and and
  634.       or
  635.     { format.title.p output.nonnull }
  636.     { format.title output.nonnull }
  637.       if$
  638.       blank.sep
  639.     }
  640.   if$
  641.   howpublished output
  642.   address output
  643.   format.date output
  644.   new.block
  645.   note output
  646.   fin.entry
  647. }
  648.  
  649. FUNCTION {inbook}
  650. { output.bibitem
  651.   author empty$
  652.     { format.editors "author and editor" output.check }
  653.     { format.authors output.nonnull
  654.       crossref missing$
  655.     { "author and editor" editor either.or.check }
  656.     'skip$
  657.       if$
  658.     }
  659.   if$
  660.   format.btitle "title" output.check
  661.   crossref missing$
  662.     { format.bvolume output
  663.       format.chapter.pages "chapter and pages" output.check
  664.       new.block
  665.       format.number.series output
  666.       format.addr.pub "publisher" output.check
  667.     }
  668.     { format.chapter.pages "chapter and pages" output.check
  669.       new.block
  670.       format.book.crossref output.nonnull
  671.     }
  672.   if$
  673.   format.edition output
  674.   format.date "year" output.check
  675.   new.block
  676.   note output
  677.   fin.entry
  678. }
  679.  
  680. FUNCTION {incollection}
  681. { output.bibitem
  682.   format.authors "author" output.check
  683.   format.title "title" output.check
  684.   blank.sep
  685.   crossref missing$
  686.     { format.in.ed.booktitle "booktitle" output.check
  687.       format.bvolume output
  688.       format.number.series output
  689.       format.chapter.pages output
  690.       format.addr.pub "publisher" output.check
  691.       format.edition output
  692.       format.date "year" output.check
  693.     }
  694.     { format.incoll.inproc.crossref output.nonnull
  695.       format.chapter.pages output
  696.     }
  697.   if$
  698.   new.block
  699.   note output
  700.   fin.entry
  701. }
  702.  
  703. FUNCTION {inproceedings}
  704. { output.bibitem
  705.   format.authors "author" output.check
  706.   format.title "title" output.check
  707.   blank.sep
  708.   crossref missing$
  709.     { format.in.ed.booktitle "booktitle" output.check
  710.       format.bvolume output
  711.       format.number.series output
  712.       format.paddress output
  713.       format.pages output
  714.       organization output
  715.       publisher output
  716.       format.date "year" output.check
  717.     }
  718.     { format.incoll.inproc.crossref output.nonnull
  719.       format.pages output
  720.     }
  721.   if$
  722.   new.block
  723.   note output
  724.   fin.entry
  725. }
  726.  
  727. FUNCTION {conference} { inproceedings }
  728.  
  729. FUNCTION {manual}
  730. { output.bibitem
  731.   author empty$
  732.     { organization empty$
  733.     'skip$
  734.     { organization output.nonnull
  735.       address output
  736.     }
  737.       if$
  738.     }
  739.     { format.authors output.nonnull }
  740.   if$
  741.   format.btitle "title" output.check
  742.   author empty$
  743.     { organization empty$
  744.     { address new.block.checka
  745.       address output
  746.     }
  747.     'skip$
  748.       if$
  749.     }
  750.     { organization address new.block.checkb
  751.       organization output
  752.       address output
  753.     }
  754.   if$
  755.   format.edition output
  756.   format.date output
  757.   new.block
  758.   note output
  759.   fin.entry
  760. }
  761.  
  762. FUNCTION {mastersthesis}
  763. { output.bibitem
  764.   format.authors "author" output.check
  765.   format.title "title" output.check
  766.   blank.sep
  767.   "Master's thesis" format.thesis.type output.nonnull
  768.   school "school" output.check
  769.   address output
  770.   format.date "year" output.check
  771.   new.block
  772.   note output
  773.   fin.entry
  774. }
  775.  
  776. FUNCTION {misc}
  777. { output.bibitem
  778.   format.authors output
  779.   title empty$
  780.     { howpublished new.sentence.checka }
  781.     { howpublished empty$ not
  782.       month empty$ year empty$ and
  783.       or
  784.     { format.title.p output.nonnull }
  785.     { format.title output.nonnull }
  786.       if$
  787.       blank.sep
  788.     }
  789.   if$
  790.   howpublished output
  791.   format.date output
  792.   new.block
  793.   note output
  794.   fin.entry
  795.   empty.misc.check
  796. }
  797.  
  798. FUNCTION {phdthesis}
  799. { output.bibitem
  800.   format.authors "author" output.check
  801.   format.btitle "title" output.check
  802.   new.block
  803.   "PhD thesis" format.thesis.type output.nonnull
  804.   school "school" output.check
  805.   address output
  806.   format.date "year" output.check
  807.   new.block
  808.   note output
  809.   fin.entry
  810. }
  811.  
  812. FUNCTION {proceedings}
  813. { output.bibitem
  814.   editor empty$
  815.     { organization output }
  816.     { format.editors output.nonnull }
  817.   if$
  818.   format.btitle "title" output.check
  819.   format.bvolume output
  820.   format.number.series output
  821.   format.paddress output
  822.   editor empty$
  823.     'skip$
  824.     { organization output }
  825.   if$
  826.   publisher output
  827.   format.date "year" output.check
  828.   new.block
  829.   note output
  830.   fin.entry
  831. }
  832.  
  833. FUNCTION {techreport}
  834. { output.bibitem
  835.   format.authors "author" output.check
  836.   format.title "title" output.check
  837.   blank.sep
  838.   format.tr.number output.nonnull
  839.   institution "institution" output.check
  840.   address output
  841.   format.date "year" output.check
  842.   new.block
  843.   note output
  844.   fin.entry
  845. }
  846.  
  847. FUNCTION {unpublished}
  848. { output.bibitem
  849.   format.authors "author" output.check
  850.   format.title.p "title" output.check
  851.   blank.sep
  852.   note "note" output.check
  853.   format.date output
  854.   fin.entry
  855. }
  856.  
  857. FUNCTION {default.type} { misc }
  858.  
  859. MACRO {jan} {"Jan."}
  860.  
  861. MACRO {feb} {"Feb."}
  862.  
  863. MACRO {mar} {"Mar."}
  864.  
  865. MACRO {apr} {"Apr."}
  866.  
  867. MACRO {may} {"May"}
  868.  
  869. MACRO {jun} {"June"}
  870.  
  871. MACRO {jul} {"July"}
  872.  
  873. MACRO {aug} {"Aug."}
  874.  
  875. MACRO {sep} {"Sept."}
  876.  
  877. MACRO {oct} {"Oct."}
  878.  
  879. MACRO {nov} {"Nov."}
  880.  
  881. MACRO {dec} {"Dec."}
  882.  
  883. MACRO {acmcs} {"ACM Computing Surveys"}
  884.  
  885. MACRO {acta} {"Acta Informatica"}
  886.  
  887. MACRO {cacm} {"Communications ACM"}
  888.  
  889. MACRO {ibmjrd} {"IBM J. Research and Development"}
  890.  
  891. MACRO {ibmsj} {"IBM Systems~J."}
  892.  
  893. MACRO {ieeese} {"IEEE Trans. Software Engineering"}
  894.  
  895. MACRO {ieeetc} {"IEEE Trans. Computers"}
  896.  
  897. MACRO {ieeetcad}
  898.  {"IEEE Trans. Computer-Aided Design"}
  899.  
  900. MACRO {ipl} {"Information Processing Letters"}
  901.  
  902. MACRO {jacm} {"J.~ACM"}
  903.  
  904. MACRO {jcss} {"J.~Computer and System Sciences"}
  905.  
  906. MACRO {scp} {"Science of Computer Programming"}
  907.  
  908. MACRO {sicomp} {"SIAM J. Computing"}
  909.  
  910. MACRO {tocs} {"ACM Trans. Computer Systems"}
  911.  
  912. MACRO {tods} {"ACM Trans. Database Systems"}
  913.  
  914. MACRO {tog} {"ACM Trans. Graphics"}
  915.  
  916. MACRO {toms} {"ACM Trans. Mathematical Software"}
  917.  
  918. MACRO {toois} {"ACM Trans. Office Information Systems"}
  919.  
  920. MACRO {toplas} {"ACM Trans. Programming Languages and Systems"}
  921.  
  922. MACRO {tcs} {"Theoretical Computer Science"}
  923.  
  924. READ
  925.  
  926. STRINGS { longest.label }
  927.  
  928. INTEGERS { number.label longest.label.width }
  929.  
  930. FUNCTION {initialize.longest.label}
  931. { "" 'longest.label :=
  932.   #1 'number.label :=
  933.   #0 'longest.label.width :=
  934. }
  935.  
  936. FUNCTION {longest.label.pass}
  937. { number.label int.to.str$ 'label :=
  938.   number.label #1 + 'number.label :=
  939.   label width$ longest.label.width >
  940.     { label 'longest.label :=
  941.       label width$ 'longest.label.width :=
  942.     }
  943.     'skip$
  944.   if$
  945. }
  946.  
  947. EXECUTE {initialize.longest.label}
  948.  
  949. ITERATE {longest.label.pass}
  950.  
  951. FUNCTION {begin.bib}
  952. { preamble$ empty$
  953.     'skip$
  954.     { preamble$ write$ newline$ }
  955.   if$
  956.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  957. }
  958.  
  959. EXECUTE {begin.bib}
  960.  
  961. EXECUTE {init.state.consts}
  962.  
  963. ITERATE {call.type$}
  964.  
  965. FUNCTION {end.bib}
  966. { newline$
  967.   "\end{thebibliography}" write$ newline$
  968. }
  969.  
  970. EXECUTE {end.bib}
  971.